from django.db.models.base import Model
from rest_framework.serializers import ModelSerializer, HyperlinkedModelSerializer
from django.contrib.auth.models import User, Group
from app01.models import Books, Auther

from rest_framework_bulk import BulkListSerializer, BulkSerializerMixin

# class UserSerializer(HyperlinkedModelSerializer):
#     class Meta:
#         model = User
#         fields = ('username', 'email', 'groups', 'url')

# class GroupSerializer(HyperlinkedModelSerializer):
#     class Meta:
#         model = Group
#         fields = ('url', 'name')

class BookSerializer(BulkSerializerMixin, ModelSerializer):
    class Meta:
        model = Books
        fields = "__all__"
        list_serializer_class = BulkListSerializer

class AutherSerializer(BulkSerializerMixin, ModelSerializer):
    class Meta:
        model = Auther
        list_serializer_class = BulkListSerializer
        fields = "__all__"